翻訳と辞書
Words near each other
・ Disposable email address
・ Disposable Film Festival
・ Disposable food packaging
・ Disposable grill
・ Disposable Half-Truths
・ Disposable Income (album)
・ Disposable People
・ Disposable ship
・ Disposable Soft Synth Interface
・ Disposable Teens
・ Disposable towel
・ Disposal
・ Disposal of a corpse with intent to obstruct or prevent a coroner's inquest
・ Disposal of human corpses
・ Disposal tax effect
Dispose pattern
・ Disposición Final
・ Dispositif
・ Dispositio
・ Dispositio Achillea
・ Disposition
・ Disposition (disambiguation)
・ Disposition (harpsichord)
・ Disposition effect
・ Disposition Matrix
・ Dispositional affect
・ Dispositional attribution
・ Dispositionist
・ Dispositive motion
・ Disproportionate Asset case against Jayalalithaa


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Dispose pattern : ウィキペディア英語版
Dispose pattern

In computer programming, the dispose pattern is a design pattern which is used to handle resource cleanup and prevent resource leaks in runtime environments that use automatic garbage collection. The fundamental problem that the dispose pattern aims to solve is that, because objects in a garbage-collected environment have finalizers rather than destructors, there is no guarantee that an object will be destroyed at any deterministic point in time. The dispose pattern works around this by giving an object a method (usually called Dispose or similar) which frees any resources the object is holding onto.
Many garbage-collected languages offer language constructs to avoid having to call the dispose method explicitly in many situations. These language constructs leads to results similar to what is obtained with the Resource Acquisition Is Initialization (RAII) idiom in languages with deterministic memory management (e.g. C++).
== Motivation ==

It is very common to write code similar to the listing below when using resources that might throw exceptions in garbage-collected languages:

Resource resource = null;
try finally

The try...finally construct is necessary for proper exception safety, since the finally block enables execution of cleanup logic regardless of if an exception is thrown or not in the try block.
One disadvantage of this approach is that it requires the programmer to explicitly add cleanup code in a finally block. This leads to code size bloat, and failure to do so will lead to resource leakage in the program.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Dispose pattern」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.